package com.tang.lts.core.nio.handler;

import com.tang.lts.core.nio.channel.NioChannel;

/**
 * @author Tang
 * @classname Futures
 * @description [  ]
 * @date 2022/5/15 15:43
 */
public class Futures {

    public static ConnectFuture newConnectFuture() {
        return new ConnectFuture();
    }

    public static CloseFuture newCloseFuture() {
        return new CloseFuture();
    }

    public static WriteFuture newWriteFuture() {
        return new WriteFuture();
    }

    public static class ConnectFuture extends IoFuture{

        private NioChannel channel;

        public NioChannel getChannel() {
            return channel;
        }

        public void setChannel(NioChannel channel) {
            this.channel = channel;
        }
    }

    public static class CloseFuture extends IoFuture{

        private NioChannel channel;

        public NioChannel getChannel() {
            return channel;
        }

        public void setChannel(NioChannel channel) {
            this.channel = channel;
        }

    }

    /**
     * 写操作是否完成
     */
    public static class WriteFuture extends IoFuture {

    }

}